/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: MultyDiscount
 * Author:   zhouheng
 * Date:     2019/5/1 23:16
 * Description: 多种折扣抽象类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.patterns.com.zhouh.action.chain;

import com.zhouh.patterns.com.zhouh.action.strategy.Discount;


/**
 * 〈一句话功能简述〉<br> 
 * 〈多种折扣抽象类〉
 *
 * @author zhouheng
 * @create 2019/5/1
 * @since 1.0.0
 */
public abstract class MultyDiscount implements Discount{
    public MultyDiscount next;

    public MultyDiscount(MultyDiscount next) {
        this.next = next;
    }

    @Override
    public int calculate(int money) {
        if (next != null){
            return next.calculate(money);
        }

        return money;
    }
}